<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\Member\User;
use Log;

class Test extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
            $userInfo = [
                'openid' => 'oQGah1MgclrFkzCZMgtwH4Pm4MjY',
                'nickname' => '存在',
                'headimgurl' => '存在'
            ];

            $user = new User;
            $res = $user->bind(8, 8593, $userInfo);
            echo "\n";
            Log::info($res);
            var_dump($res);
        return;
        for ($i=2; $i<10; $i++) {
            $userInfo = [
                'openid' => 'oQGah1Nv8MhJII6D3o0wyj-evKXM',
                'nickname' => 'test1'. $i,
                'headimgurl' => 'test1'. $i
            ];

            $user = new User;
            $res = $user->bind(8, 8594, $userInfo);
            echo "\n";
            var_dump($res);
        }
    }
}
